var status = -1;
var selectionLog = [];

function start() {
    status = -1;
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (cm.isQuestActive(20752) || cm.isQuestActive(20753) || cm.isQuestActive(20755)) {
                cm.dispose();
                cm.forceCompleteQuest(20752);
                cm.forceCompleteQuest(20753);
                cm.forceCompleteQuest(20755);
                return
            }
            cm.hideNpc(9000202);
            cm.hideNpc(9001116);
            cm.hideNpc(9001117);
            cm.hideNpc(9001119);
            cm.Hidden_background("door0", 1, cm.getLevel() >= 200 ? 1 : 0, 0, 0);
            cm.Hidden_background("door1", 1, cm.getLevel() >= 200 ? 1 : 0, 0, 0);
            cm.dispose()
        }
    }
};